#region Header Licence
//  NKnobMan, Copyright 2009, Alexandre MUTEL.
// 
//  This is free software; you can redistribute it and/or modify it
//  under the terms of the GNU Lesser General Public License as
//  published by the Free Software Foundation; either version 2.1 of
//  the License, or (at your option) any later version.
// 
//  This software is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//  Lesser General Public License for more details.
// 
//  You should have received a copy of the GNU Lesser General Public
//  License along with this software; if not, write to the Free
//  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
//  02110-1301 USA, or see the FSF site: http://www.fsf.org.
#endregion
using System;

namespace NKnobMan.Templatizer
{
    /// <summary>
    /// Helper class for domain values for the KnobTemplate.
    /// </summary>
    public class KnobTemplateController
    {
        public static LayerEnum[] GetLayerItems(KnobMan knobMan)
        {
            LayerEnum[] values = new LayerEnum[knobMan.PrefsLayers + 1];
            values[0] = LayerEnum.All;
            for(int i = 0; i < knobMan.PrefsLayers; i++)
            {
                values[i + 1] = (LayerEnum)Enum.Parse(typeof (LayerEnum), "" + (i + 1));
            }
            return values;            
        }

        public static string[] GetTemplateOperationItems()
        {
            return Layer.GetKnobManCommands();
        }

        public static Type GetValueTypeForOperation(string operation)
        {
            return typeof (int);
        }

        public static Array GetPreviewMouseEventItems()
        {
            return Enum.GetValues(typeof (PreviewMouseEvent));
        }

        public static Array GetKnobParentItems()
        {
            return Enum.GetValues(typeof(IterationInput));
        }

        public static Array GetKnobOutputAlignement()
        {
            return Enum.GetValues(typeof(OutputAlignement));
        }

    }
}